Remove Elements from an Array Using slice Instead of splice